import java.util.*;
import java.util.Map.Entry;

public class TestDemo {

    public static void main(String[] args) {

    }

    public static void main6(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine().toUpperCase();
        String s2 = scanner.nextLine().toUpperCase();

        //存储没有坏的键
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < s2.length(); i++) {
            set.add(s2.charAt(i));
        }

        //存储输出过的坏键
        Set<Character> set1 = new HashSet<>();
        StringBuilder stringBuilder = new StringBuilder();

        for (int i = 0; i < s1.length(); i++) {
            char c = s1.charAt(i);
            //没有坏的键中没有
            if (!set.contains(c)) {
                //输出过的也没有
                if (!set1.contains(c)) {
                    stringBuilder.append(c);
                    set1.add(c);
                }
            }
        }
        System.out.print(stringBuilder);
    }

    public static void main5(String[] args) {
        Random random = new Random();
        int[] arr = new int[10_0000];
        int c = 0;
        while (c < arr.length) {
            arr[c++] = random.nextInt(5_000);
        }
        c = 0;
        HashMap<Integer, Integer> hashMap = new HashMap<>();
        while (c < arr.length) {
            if (hashMap.containsKey(arr[c])) {
                hashMap.put(arr[c], 1 + hashMap.getOrDefault(arr[c],0));
                c++;
            } else {
                hashMap.put(arr[c++], 1);
            }
        }
        Set<Map.Entry<Integer, Integer>> set = hashMap.entrySet();
        for (Entry<Integer, Integer> e:
             set) {
            System.out.println(e);
        }
    }

    public static void main4(String[] args) {
        Random random = new Random();
        int[] arr = new int[10_0000];
        int c = 0;
        while (c < arr.length) {
            arr[c++] = random.nextInt(5_000);
        }
        c = 0;
        HashSet<Integer> hashSet = new HashSet<>();
        while (c < arr.length) {
            if (hashSet.contains(arr[c])) {
                System.out.println("第一次出现重复的数据是：" + arr[c]);
                break;
            } else {
                hashSet.add(arr[c++]);
            }
        }
    }

    public static void main3(String[] args) {
        Random random = new Random();
        int[] arr = new int[10_0000];
        int c = 0;
        while (c < arr.length) {
            arr[c++] = random.nextInt(5_000);
        }
        c = 0;
        HashSet<Integer> hashSet = new HashSet<>();
        while (c < arr.length) {
            hashSet.add(arr[c++]);
        }
        Iterator<Integer> it = hashSet.iterator();
        while (it.hasNext()) {
            System.out.print(it.next() + " ");
        }
    }

    public static void main2(String[] args) {
        Map<String, Integer> m = new HashMap<>();
        m.put("Matty", 21);
        m.put("Justin", 28);
        System.out.println(m.get("Matty"));
        m.put("Kendall", 25);
        m.put("Matty", 22);
        Set<Entry<String, Integer>> set = m.entrySet();
        for (Entry e:
             set) {
            System.out.println(e);
        }
        System.out.println(m.getOrDefault("Matty", 90));
        System.out.println(m.getOrDefault("Bieber", 28));
        for (String s: m.keySet()) {
            System.out.print(s + " ");
        }
        System.out.println();
        for (Integer i : m.values()) {
            System.out.print(i + " ");
        }
    }

    public static void main1(String[] args) {
        int[] arr = new int[]{6,9,6,3,5,8,4,7};
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        for (int i = 0; i < arr.length; i++) {
            binarySearchTree.insert(arr[i]);
        }
        binarySearchTree.remove(8);
        System.out.println();
    }

}
